//
//  LSZPlayImageAndTableViewVC+LCAVPlay.m
//  JKFuYinProject
//
//  Created by 九酷 on 2017/10/10.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZPlayImageAndTableViewVC+LCAVPlay.h"
#import "LSZPlayImageAndTableViewVC.h"

@implementation LSZPlayImageAndTableViewVC (LCAVPlay)
-(void)creareAVPlay{
    // 安装通知
    [self setupNotificationsPlayImage];
}

- (void)dealloc {
    [self teardownNotificationsPlayImage];
}
#pragma mark - 通知处理 -
// 安装通知
- (void)setupNotificationsPlayImage {
    //这个是模态到另外的界面
    if([self.typeComeWhere isEqualToString:@"3"]){
        //诗歌的分类 二级界面 , 不需要重复添加通知
    }else{
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveNotification:) name:@"PUSHPLAYPAGE" object:nil];
    }

    // 2. 安装播放歌曲发生变化的通知
//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(musicPlayerPlayingSongDidChangedNotification:) name:LCMusicPlayerPlayingSongDidChangedNotification object:_LCPlayer];
}

// 卸载通知
- (void)teardownNotificationsPlayImage {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}
#pragma mark - 通知处理回调
///跳转到相关播放页
-(void)musicPlayerPlayingSongDidChangedNotification:(NSNotification *)notification{
    //    JKSongsMessStatus *playingSong = notification.userInfo[kMusicPlayerPlayingSong];
    
    if (_LCPlayer.selectedIndex != self.numberRow) {
//        [self changeSomeMessAndPlaySong:_LCPlayer.selectedIndex + 1];
        
    }
}
///跳转到播放页
-(void)receiveNotification:(NSNotification *)notification{
    
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LCPlayStoryboard" bundle:nil];
    UIViewController *controller = [sb instantiateInitialViewController];
    [self presentViewController:controller animated:YES completion:nil];
    
}
@end
